import {BaseAddDTO, BaseDetailsDTO, BaseListDTO, BasePageQuery, BaseUpdateDTO} from '@/types/baseInterface'
import {TipInfo} from "@/api/types/commonTypes";

/**
 * 数据源添加
 */
export interface DataSourceAddDTO extends BaseAddDTO {
    name: string,
    url: string,
    username: string,
    password: string,
    type: string,
    contentType: string,
    content: string,
    tablePrefix: string,
    exclusionTable: string
}

/**
 * 数据源修改
 */
export interface DataSourceUpdateDTO extends BaseUpdateDTO {
    name: string,
    url: string,
    username: string,
    password: string,
    type: string,
    contentType: string,
    content: string,
    tablePrefix: string,
    exclusionTable: string
}


/**
 * 数据源详情
 */
export interface DataSourceDetailsDTO extends BaseDetailsDTO {
    name: string,
    url: string,
    username: string,
    password: string,
    type: string,
    typeName: string,
    contentType: string,
    contentTypeName: string,
    content: string,
    tablePrefix: string,
    exclusionTable: string
}

/**
 * 数据源列表
 */
export interface DataSourceListDTO extends BaseListDTO {
    name: string,
    url: string,
    username: string,
    password: string,
    type: string,
    typeName: string,
    contentType: string,
    contentTypeName: string,
    content: string,
    tablePrefix: string,
    exclusionTable: string
}

export interface DataSourceActualContent extends DataSourceListDTO {
    dataObj: object
}

export interface DataSourceQuery extends BasePageQuery {
    name?: string
    type?: string
    contentType?: string
}

/**
 * 支持的类型
 */
export interface SupportType {
    type: TipInfo,
    contentType: TipInfo[]
}

/**
 * 表信息
 */
export interface MyTable {
    originalTableName: string;
    tableName: string;
    tableComment: string;
    importPackages: string[];
    columns: Column[];
}

/**
 * 字段信息
 */
export interface Column {
    columnName: string;
    columnType: string;
    columnJavaType: string;
    columnComment: string;
}

